package com.gitee.wsl.func.predicate


abstract class PairPredicate<T1, T2>
    : Predicate<Pair<T1, T2>>, BiPredicate<T1, T2> {
     override fun accept(t: Pair<T1, T2>): Boolean {
        return this.accept(t.first, t.second)
    }

    override fun negate(): PairPredicate<T1, T2> {
        return object : PairPredicate<T1, T2>() {
             override fun test(a: T1, b: T2): Boolean {
                return !this@PairPredicate.test(a, b)
            }

            override fun test(t: Pair<T1, T2>): Boolean {
                return !this@PairPredicate.test(t)
            }
        }
    }

}
